<!DOCTYPE HTML>
<html>

<head>
   <title> 修改密码</title>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <link href="../../../assets/css/dpl-min.css" rel="stylesheet" type="text/css" />
   <link href="../../../assets/css/bui-min.css" rel="stylesheet" type="text/css" />
   <link href="../../../assets/css/page-min.css" rel="stylesheet" type="text/css" />
   <link href="../../../assets/css/jx-style.css" rel="stylesheet" type="text/css" />
   <link href="../../../assets/css/prettify.css" rel="stylesheet" type="text/css" />
</head>

<body>
   <div class="container">
      <div class="detail-page span24">
         <div class="detail-page-title">
            <h4>修改密码
            </h4>
         </div>
         <div class="detail-section">
            <div class="row detail-row">
               <div class="span24">
                  <form id="form" class="form-horizontal  jx-form" method="post" aria-disabled="false" action="" aria-pressed="false">
                     <div class="control-group offset6" style=" margin-bottom: 20px;">
                        <label class="control-label"><s>*</s>原始密码：</label>
                        <div class="controls">
                           <input type="password" id="Pwd" name="uPwd" data-rules="{required:true,minlength:6,maxlength:16}" class="input-normal control-text bui-form-field"
                              aria-disabled="false" aria-pressed="false">
                        </div>
                     </div>
                     <div class="control-group offset6" style=" margin-bottom: 20px;">
                        <label class="control-label"><s>*</s>输入新密码：</label>
                        <div class="controls">
                           <input type="password" id="uPwd" name="uPwd" data-rules="{required:true,minlength:6,maxlength:16}" class="input-normal control-text bui-form-field"
                              aria-disabled="false" aria-pressed="false">
                        </div>
                     </div>
                     <div class="control-group offset6">
                        <label class="control-label"><s>*</s>确认新密码：</label>
                        <div class="controls">
                           <input type="password" id="againUPwd" name="againUPwd" data-rules="{required:true, equalTo:'#uPwd',minlength:6,maxlength:16}"
                              class="input-normal control-text bui-form-field" aria-disabled="false" aria-pressed="false">
                        </div>
                     </div>
                     <div class="actions-bar">
                        <div class="row">
                           <div class="span12 offset10 ">
                              <button id="modifyPwd" type="button" class="jx-btn btn-default  btn-large">保存
                                    </button>
                              <button type="reset" class="jx-btn btn-positive btn-large">重置</button>
                           </div>
                        </div>
                     </div>
                  </form>
               </div>
            </div>
         </div>
      </div>
   </div>
   <script type="text/javascript" src="../../../assets/js/jquery-1.8.1.min.js"></script>
   <script type="text/javascript" src="../../../assets/js/bootstrap.js"></script>
   <script type="text/javascript" src="../../../assets/js/bui-min.js"></script>
   <script type="text/javascript" src="../../../assets/js/config-min.js"></script>
   <script type="text/javascript">
      BUI.use('common/page');
   </script>

   <script type="text/javascript">
      BUI.use(['bui/grid', 'bui/data', 'common/search', 'bui/tab', 'bui/calendar', 'bui/form', 'bui/overlay'], function (
         Grid,
         Data, Search, Tab, Calendar, Form, Overlay) {
         var form = new Form.HForm({
            srcNode: '#form'
         }).render();

         //修改密码
         $('#modifyPwd').on('click', function () {
            var check = form;
            //检验
            check.valid();
            if (check.isValid()) {
               var uPwd = $("#againUPwd").val();
               // var uPwd = encryptionStr($("#againUPwd").val());
               $.ajax({
                  type: "post",
                  url: basePath + '/admin/admSupplierAction/setUPwd',
                  data: {
                     'uPwd': uPwd
                  },
                  async: false,
                  success: function (res) {
                     if (res.status == SUCCESS) {
                        BUI.Message.Alert('操作成功', 'success');
                        setTimeout(function () {
                           //注销
                           window.location.href = basePath + '/admin/admUser/loginout';
                        }, 1000);
                     } else {
                        BUI.Message.Alert(res.info, "error");
                     }
                  }
               });
            }
         });

      });
   </script>